﻿using System;
using System.Collections;
using System.Data;
using System.Data.OleDb;
using System.Data.SqlClient;
using System.Xml;

using Microsoft.Win32;

using Aulac.Srv.Db.Connect; using Aulac.Srv.Db.Common;
using System.Collections.Generic;
using Aulac.Global.Enums; using Aulac.Global.Data; using Aulac.Global.Common; using Aulac.Global.Xml;
using Aulac.Srv.Db.Data.Catalogs;
using Aulac.Rsc.Bss;
using Aulac.Rsc.Bss.Tags;
using Aulac.Srv.Data.XmlQuery;



namespace Aulac.Srv.Db.Data.Ems.Items
{
	/// <summary>
	/// Summary description for Department
	/// </summary>
    public partial class Dept : Aulac.Srv.Db.Data.Ems.Document.DbEmsDataDocumentMangager
	{
        public Dept(IDbAulacConnect p_Db)
            : base(p_Db)
        {
        }
        List<string> mList = new List<string>(new string[] { tagItems.Department.DeptPrkID, tagItems.Department.DeptID, tagItems.Department.DeptName });

        public XmlDataDocument GetListDept(XmlDataDocument xmlData)
        {
            try
            {
                string[] sArr = new string[] { tagItems.Department.DeptPrkID, tagItems.Department.DeptID, tagItems.Department.DeptName };
                XmlDataDocument xmlDoc = CreateXmlDocument("", "");
                string sqlQuery = string.Format("SELECT	{0}", StringHelper.ConvertArrayToString(", ", sArr));
                sqlQuery += string.Format(" FROM {0}", TableNames.Dm_Department);
                
                SrvExecXmlQueryData query = new SrvExecXmlQueryData(DbDataProvider);
                query.SetVchLinesElm(QueryCmdTypes.SelectData);
                query.ObjQueryVchLines.SqlQueryString = sqlQuery;
                return query.ExecureQuery();                
            }
            catch (Exception Ex)
            {
                throw Ex;
            }
        }
  
       
	}
}
